# Maintainer: Anatol Pomozov

pkgname=linenoise-ng
pkgver=1.0.1
pkgrel=2
pkgdesc='A small self-contained alternative to readline and libedit that supports UTF-8 and Windows'
arch=(loong64 x86_64)
url='https://github.com/arangodb/linenoise-ng'
license=(BSD)
makedepends=('cmake')
source=(linenoise-ng-$pkgver.zip::https://github.com/arangodb/linenoise-ng/archive/v$pkgver.zip)
sha256sums=('af16575c73435601161d9e6bdfbc58983a78ec16fb3707c18df4171419379c54')

build() {
  cd linenoise-ng-$pkgver
  cmake -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_CXX_FLAGS="$CXXFLAGS -ffat-lto-objects" \
        -S . \
        -B build
  cmake --build build
}

package() {
  cd linenoise-ng-$pkgver
  cmake --build build --target install -- DESTDIR="$pkgdir/"
}
